{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import sys \n",
    "\n",
    "# Modify the path \n",
    "sys.path.append(\"..\")\n",
    "\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import yellowbrick as yb\n",
    "import matplotlib.pyplot as plt \n",
    "\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.ensemble import AdaBoostClassifier\n",
    "\n",
    "from yellowbrick.classifier import ConfusionMatrix"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Before\n",
    "\n",
    "Currently, the percents in rows of the `ConfusionMatrix` don't always add up to 100!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "occupancy = pd.read_csv('data/occupancy/occupancy.csv')\n",
    "features = [\n",
    "    \"temperature\", \"relative humidity\", \"light\", \"C02\", \"humidity\"\n",
    "]\n",
    "classes = [\"unoccupied\", \"occupied\"]\n",
    "oX = occupancy[features]\n",
    "oy = occupancy['occupancy']\n",
    "\n",
    "# Create the train and test data\n",
    "oX_train, oX_test, oy_train, oy_test = train_test_split(oX, oy, test_size=0.2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEQCAYAAABLMTQcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAG9ZJREFUeJzt3WlgVOXZxvH/ECBsikZE0YKBorcblUVURJTWHbWK+4YrKFrU2lexrStorVurtlYtiisqSiuuFRcs4oKoYRe5owKiFURA9hAImffDOYljSEIgGSZ5cv2+ZOY5231mueY5zzkzSSSTSUREJCwNMl2AiIjUPIW7iE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hZltR9TzPyNuewoYXs4+FBN9A7NS7r7czM4ETjez3YiORKYA/wMKzOx94BXguviI5CVgtJm9QNSbf3Nj25D6S+Eutc23ca+4IgXx3yzgOXe/HEoDuSFRkKcekZb3jch1qXfMrCMwL6UpC1iTWoeZ/QxYQjQkUrL+JFGQl/UJ0RBP6jYaAP8iGrIpaWsLjCM6GniN6IOmi7sXmdn+RB9CfYAJZnaIu99tZi8DxwJ3mNm/3P1P5WxfRMMyUmeNA/qaWev4W7oPEI2/vwccYGY7x4F6WjnLjgdONbOEmbUG3iE6SigCGrr7MuBzMzsbwMwOj5cBeAs4O759Ihv+ZgrAMOAYM+sTL58ArgdalxxRxLoTfWvzbqIjkqOBLDPrEtc03t2vIrp6yMxsIrCVu98D3I2GZaQSCnepk9x9KjAEeBv4lOi1fFscnpcRhfBHRCdVy7ofWAVMjee7zN1XEP0+z4NmdiBwFtDfzKYBfyY60ZkEBgEnxe19gBXl1LaAKKj/z8ymx/XtSjS+nuoNoIGZzSQ6OTsXaO/uk4EJwAwzmxS3vwb8EXjMzPKIzgPcuCmPmdQv+vkBEZEAqecuIhIghbuISIAU7iIiAVK4i4gESOEuIhIghbuISIAU7iIiAVK4i4gE6P8BlBKdTy4mdIgAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "model = AdaBoostClassifier()\n",
    "cm = ConfusionMatrix(model, percent=True)\n",
    "cm.fit(oX_train, oy_train)\n",
    "cm.score(oX_test, oy_test)\n",
    "cm.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Load multi-class classification dataset\n",
    "game = pd.read_csv('data/game/game.csv')\n",
    "\n",
    "classes = [\"win\", \"loss\", \"draw\"]\n",
    "\n",
    "# Encode the non-numeric columns\n",
    "game.replace({'loss':-1, 'draw':0, 'win':1, 'x':2, 'o':3, 'b':4}, inplace=True)\n",
    "\n",
    "# Extract the numpy arrays from the data frame\n",
    "gX = game.iloc[:, game.columns != 'outcome']\n",
    "gy = game['outcome']\n",
    "\n",
    "# Create the train and test data\n",
    "gX_train, gX_test, gy_train, gy_test = train_test_split(gX, gy, test_size=0.2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAETCAYAAADXmaY8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3WdgVGXaxvH/kEAo0WAIaNSFwKq3iu5iEBVRxNeugKLYxbLqYlfs3bWs2MuuIgt2EbGvZRVdsbALiEsCIiJ3BERQAYVoKAmBJPN+OCcxxgQCZDLEc/2+ZObU+0xmrnnOc8rE4vE4IiLy29Ys2QWIiEjiKexFRCJAYS8iEgEKexGRCFDYi4hEgMJeRCQCUpNdgGwYM2sOfA1Md/dD65hmIHCBu/dZx7LmAaVACUEDIAV40N1HNGDJles6AtjT3W8Mn7cErgP6ArFw3aOAu9w9bmYfAg+5+0sNWMM5QFt3v8PMDgZGAt8DjwMZ7n7HRi5/J+A2YHsgDvwEXOfu/92IZVavs7e7l6zn/I8CY9z9vQ2todqyTgeeAG6t/D+Gw2PAHKDY3XdZxzLOAlq4+7BaxlX9fza2VvmZwr7pGgBMB7qb2U7u/sVGLu9kd58CYGa/AwrM7G13X7CxhdbQA8gM1xMD/gkUAD3dfZWZtQP+BaQDNzTwugFw9+HVnp4AjHT32xpi2WZmwDjgDHd/Jxx2APCmmfVy9883cNEbVae7n7WB663LfOBk4MZqw/YFWgPF9Zh/H2BGbSNq/H+kgSjsm67zgDHAbOASYDCAmd1C8CFcCnxZObGZ7QA8TBCiWwPTgOPdfVUty94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YA8gnCcaK7LwYws1HAATXWsR8wwt0rCFr5XcNpCf+mAz2AJ6rd7TLdzNoR7BmcGA57Fnislm2ooB4X0rn7MjM7CTghvFPqocA04FugxMwmENyX5/pwj+V14FUz+ydBa//f61qHRJvCXjZl34Wt5rqUhH9TgBfc/SKoCuhUgmCvvvda210P11R/YmbbAfOrDUoBVlWvw8y2BQoJulAqlx8nCPaaphB0CVVfRzPgJYIunsphvwM+JNhbeJvgi2c3dy8zsz0JvpQOByaZ2X7ufr+ZvQH0Be4ys5fc/a+1rF8EUDeO/DZ8CAwwsw5mFiPoX7+E4GrlvcxsmzBgj69l3vHAcWYWM7MOBHcoTSP4Ykh19yLgSzM7BcDMDgrnAXgPOCV8fDS/vm86wAjgCDM7PJw/BtwAdKjc4wj1AGa7+/0EeyyHASlmtltY03h3v5zg7CQzs8nAZu7+AHA/6saRdVDYS5Pn7p8CNwPvA58TvK/vCMP0QoJQ/oTgIG1Nw4CVwKfhdBe6+3KCe9gPN7O9gZOBs8xsOjCU4MBpHLgAOCYcfjiwvJbaFhEE92Vm9llY3/YE/fPVvQs0M7OZBAd75wGd3X0qMAmYYWb54fC3gWuBJ80sj+A4wk3r85pJ9Oh2CSIiEaCWvYhIBCjsRUQiQGEvIhIBCnsRkQhQ2IuIRIDCXkQkAhT2IiIR8P8PTKrWhVy3nQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "model = AdaBoostClassifier()\n",
    "cm = ConfusionMatrix(model, percent=True)\n",
    "cm.fit(gX_train, gy_train)\n",
    "cm.score(gX_test, gy_test)\n",
    "cm.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "np.random.seed(11)\n",
    "rX = pd.DataFrame(np.random.rand(500,5))\n",
    "ry = np.random.binomial(1, .6, size=500)\n",
    "\n",
    "rX_train, rX_test, ry_train, ry_test = train_test_split(rX, ry, test_size = 0.2, random_state=42)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEQCAYAAABLMTQcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAHEdJREFUeJzt3WdgVGXaxvH/TBK6DburK9YbxVUksAIiYkfsIquIdUURK7J2XJUi1gXdVURxxUKzK2B9xYIioERUEL3RBdS1oCiCFIEk8344J+wQkhBIhiRPrt+XZJ7T7jPlmuc858xMIpVKISIiYUlWdQEiIlL5FO4iIgFSuIuIBEjhLiISIIW7iEiAFO4iIgHKruoCpPzMLAf4CvjE3TuWMs8pwCXu3mEd65oHrACWE73JZwH3uPuDlVhy0baOAQ5w9xvj2/WAPsCxQCLe9gjgDndPmdlbwL3u/nQl1nAhsLm732ZmRwLDgB+Bh4HN3P22Cq5/L2AAsAeQAn4F+rj7uxVYZ3qd7d19+Xou/xAwxt1f39Aa0tZ1DjAc6F/0OMbtCeA/wDJ332cd6+gO1HH3ISVMW/34VLRWiSjca5aTgE+AXDPby90/q+D6urn7NAAz2wmYbWYvu/s3FS20mFZA43g7CeB5YDbQxt1/N7MtgReBRsDfK3nbALj70LSbpwHD3H1AZazbzAyYAJzr7q/GbYcB483sQHf/dANXXaE63b37Bm63NF8D3YAb09oOAhoAy8qxfDtgZkkTij0+UgkU7jXLRcAY4EugF9ADwMz6Eb3ofga+KJrZzPYE7iMKzR2Aj4BT3f33Eta9BbAUWBIvexBwJ9ELdyVwg7u/Ek/7O9AVyCcK6Uvc/QczOxm4ASgECoCriI4OLgSyzGwR8BqwF3CMuxcAuPvPZnYm0KR4UWZ2PXAiUA9oCFzp7s+ZWVPg33F7AnjI3YeU0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MPgFuJTrRmQIuATrH7Z2A30qo7QeioP6bmc2I69uDaHw93WtA0sxmEZ2cnQfs4u7TgcnATDP7MG5/GbgeeMTM8ojOA9y0PveZ1C76+gERkQCp5y4iEiCFu4hIgBTuIiIBUriLiARI4S4iEiCFu4hIgBTuIiIBUriLiATo/wHHM75GFSq7lgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "model = AdaBoostClassifier()\n",
    "cm = ConfusionMatrix(model, percent=True)\n",
    "cm.fit(rX_train, ry_train)\n",
    "cm.score(rX_test, ry_test)\n",
    "cm.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "##########################################################################\n",
    "## Imports\n",
    "##########################################################################\n",
    "\n",
    "import warnings\n",
    "import numpy as np\n",
    "\n",
    "from yellowbrick.utils import div_safe\n",
    "from yellowbrick.style import find_text_color\n",
    "from yellowbrick.style.palettes import color_sequence\n",
    "from yellowbrick.classifier.base import ClassificationScoreVisualizer\n",
    "\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.metrics import confusion_matrix as confusion_matrix_metric\n",
    "\n",
    "\n",
    "##########################################################################\n",
    "## ConfusionMatrix\n",
    "##########################################################################\n",
    "\n",
    "CMAP_UNDERCOLOR = 'w'\n",
    "CMAP_OVERCOLOR = '#2a7d4f'\n",
    "CMAP_MUTEDCOLOR = '0.75'\n",
    "\n",
    "\n",
    "class ConfusionMatrix(ClassificationScoreVisualizer):\n",
    "    \"\"\"\n",
    "    Creates a heatmap visualization of the sklearn.metrics.confusion_matrix().\n",
    "    A confusion matrix shows each combination of the true and predicted\n",
    "    classes for a test data set.\n",
    "\n",
    "    The default color map uses a yellow/orange/red color scale. The user can\n",
    "    choose between displaying values as the percent of true (cell value\n",
    "    divided by sum of row) or as direct counts. If percent of true mode is\n",
    "    selected, 100% accurate predictions are highlighted in green.\n",
    "\n",
    "    Requires a classification model.\n",
    "\n",
    "    Parameters\n",
    "    ----------\n",
    "    model : estimator\n",
    "        Must be a classifier, otherwise raises YellowbrickTypeError\n",
    "\n",
    "    ax : matplotlib Axes, default: None\n",
    "        The axes to plot the figure on. If None is passed in the current axes\n",
    "        will be used (or generated if required).\n",
    "\n",
    "    sample_weight: array-like of shape = [n_samples], optional\n",
    "        Passed to ``confusion_matrix`` to weight the samples.\n",
    "\n",
    "    percent: bool, default: False\n",
    "        Determines whether or not the confusion_matrix is displayed as counts\n",
    "        or as a percent of true predictions. Note, if specifying a subset of\n",
    "        classes, percent should be set to False or inaccurate figures will be\n",
    "        displayed.\n",
    "\n",
    "    classes : list, default: None\n",
    "        a list of class names to use in the confusion_matrix.\n",
    "        This is passed to the ``labels`` parameter of\n",
    "        ``sklearn.metrics.confusion_matrix()``, and follows the behaviour\n",
    "        indicated by that function. It may be used to reorder or select a\n",
    "        subset of labels. If None, classes that appear at least once in\n",
    "        ``y_true`` or ``y_pred`` are used in sorted order.\n",
    "\n",
    "    label_encoder : dict or LabelEncoder, default: None\n",
    "        When specifying the ``classes`` argument, the input to ``fit()``\n",
    "        and ``score()`` must match the expected labels. If the ``X`` and ``y``\n",
    "        datasets have been encoded prior to training and the labels must be\n",
    "        preserved for the visualization, use this argument to provide a\n",
    "        mapping from the encoded class to the correct label. Because typically\n",
    "        a Scikit-Learn ``LabelEncoder`` is used to perform this operation, you\n",
    "        may provide it directly to the class to utilize its fitted encoding.\n",
    "\n",
    "    cmap : string, default: ``'YlOrRd'``\n",
    "        Specify a colormap to define the heatmap of the predicted class\n",
    "        against the actual class in the confusion matrix.\n",
    "\n",
    "    fontsize : int, default: None\n",
    "        Specify the fontsize of the text in the grid and labels to make the\n",
    "        matrix a bit easier to read. Uses rcParams font size by default.\n",
    "\n",
    "    Attributes\n",
    "    ----------\n",
    "    score_ : float\n",
    "        Global accuracy score\n",
    "\n",
    "    confusion_matrix_ : array, shape = [n_classes, n_classes]\n",
    "        The numeric scores of the confusion matrix\n",
    "\n",
    "    class_counts_ : array, shape = [n_classes,]\n",
    "        The total number of each class supporting the confusion matrix\n",
    "\n",
    "    Examples\n",
    "    --------\n",
    "    >>> from yellowbrick.classifier import ConfusionMatrix\n",
    "    >>> from sklearn.linear_model import LogisticRegression\n",
    "    >>> viz = ConfusionMatrix(LogisticRegression())\n",
    "    >>> viz.fit(X_train, y_train)\n",
    "    >>> viz.score(X_test, y_test)\n",
    "    >>> viz.show()\n",
    "    \"\"\"\n",
    "\n",
    "\n",
    "    def __init__(self, model, ax=None, classes=None, sample_weight=None,\n",
    "                 percent=False, label_encoder=None, cmap='YlOrRd',\n",
    "                 fontsize=None, **kwargs):\n",
    "        super(ConfusionMatrix, self).__init__(\n",
    "            model, ax=ax, classes=classes, **kwargs\n",
    "        )\n",
    "\n",
    "        # Visual parameters\n",
    "        self.cmap = color_sequence(cmap)\n",
    "        self.cmap.set_under(color=CMAP_UNDERCOLOR)\n",
    "        self.cmap.set_over(color=CMAP_OVERCOLOR)\n",
    "        self.fontsize = fontsize\n",
    "\n",
    "        # Estimator parameters\n",
    "        self.label_encoder = label_encoder\n",
    "        self.sample_weight = sample_weight\n",
    "        self.percent = percent\n",
    "\n",
    "        # Used to draw diagonal line for predicted class = true class\n",
    "        self._edgecolors = []\n",
    "\n",
    "    def score(self, X, y, **kwargs):\n",
    "        \"\"\"\n",
    "        Draws a confusion matrix based on the test data supplied by comparing\n",
    "        predictions on instances X with the true values specified by the\n",
    "        target vector y.\n",
    "\n",
    "        Parameters\n",
    "        ----------\n",
    "        X : ndarray or DataFrame of shape n x m\n",
    "            A matrix of n instances with m features\n",
    "\n",
    "        y : ndarray or Series of length n\n",
    "            An array or series of target or class values\n",
    "\n",
    "        Returns\n",
    "        -------\n",
    "\n",
    "        score_ : float\n",
    "            Global accuracy score\n",
    "        \"\"\"\n",
    "        # Perform deprecation warnings for attributes to score\n",
    "        # TODO: remove this in v0.9\n",
    "        for param in (\"percent\", \"sample_weight\"):\n",
    "            if param in kwargs:\n",
    "                warnings.warn(PendingDeprecationWarning((\n",
    "                    \"specifying '{}' in score is no longer supported, \"\n",
    "                    \"pass to constructor of the visualizer instead.\"\n",
    "                ).format(param)))\n",
    "\n",
    "                setattr(self, param, kwargs[param])\n",
    "\n",
    "        # Create predictions from X (will raise not fitted error)\n",
    "        y_pred = self.predict(X)\n",
    "\n",
    "        # Encode the target with the supplied label encoder\n",
    "        if self.label_encoder:\n",
    "            try :\n",
    "                y = self.label_encoder.inverse_transform(y)\n",
    "                y_pred = self.label_encoder.inverse_transform(y_pred)\n",
    "            except AttributeError:\n",
    "                # if a mapping is passed to class apply it here.\n",
    "                y = np.array([self.label_encoder[x] for x in y])\n",
    "                y_pred = np.array([self.label_encoder[x] for x in y_pred])\n",
    "\n",
    "        # Compute the confusion matrix and class counts\n",
    "        self.confusion_matrix_ = confusion_matrix_metric(\n",
    "            y, y_pred, labels=self.classes_, sample_weight=self.sample_weight\n",
    "        )\n",
    "        self.class_counts_ = self.class_counts(y)\n",
    "\n",
    "        # Make array of only the classes actually being used.\n",
    "        # Needed because sklearn confusion_matrix only returns counts for\n",
    "        # selected classes but percent should be calculated on all classes\n",
    "        selected_class_counts = []\n",
    "        for c in self.classes_:\n",
    "            try:\n",
    "                selected_class_counts.append(self.class_counts_[c])\n",
    "            except KeyError:\n",
    "                selected_class_counts.append(0)\n",
    "        self.class_counts_ = np.array(selected_class_counts)\n",
    "\n",
    "        self.draw()\n",
    "\n",
    "        # Retrieve and store the score attribute from the sklearn classifier\n",
    "        self.score_ = self.estimator.score(X, y)\n",
    "\n",
    "        return self.score_\n",
    "\n",
    "    def draw(self):\n",
    "        \"\"\"\n",
    "        Renders the classification report; must be called after score.\n",
    "        \"\"\"\n",
    "\n",
    "        # Perform display related manipulations on the confusion matrix data\n",
    "        cm_display = self.confusion_matrix_\n",
    "\n",
    "        # Convert confusion matrix to percent of each row, i.e. the\n",
    "        # predicted as a percent of true in each class.\n",
    "        if self.percent == True:\n",
    "            # Note: div_safe function returns 0 instead of NAN.\n",
    "            cm_display = div_safe(self.confusion_matrix_, self.class_counts_.reshape(-1,1))\n",
    "            cm_display = np.round(cm_display* 100, decimals=0)\n",
    "\n",
    "        # Y axis should be sorted top to bottom in pcolormesh\n",
    "        cm_display = cm_display[::-1,::]\n",
    "\n",
    "        # Set up the dimensions of the pcolormesh\n",
    "        n_classes = len(self.classes_)\n",
    "        X, Y = np.arange(n_classes+1), np.arange(n_classes+1)\n",
    "        self.ax.set_ylim(bottom=0, top=cm_display.shape[0])\n",
    "        self.ax.set_xlim(left=0, right=cm_display.shape[1])\n",
    "\n",
    "        # Fetch the grid labels from the classes in correct order; set ticks.\n",
    "        xticklabels = self.classes_\n",
    "        yticklabels = self.classes_[::-1]\n",
    "        ticks = np.arange(n_classes) + 0.5\n",
    "\n",
    "        self.ax.set(xticks=ticks, yticks=ticks)\n",
    "        self.ax.set_xticklabels(xticklabels, rotation=\"vertical\", fontsize=self.fontsize)\n",
    "        self.ax.set_yticklabels(yticklabels, fontsize=self.fontsize)\n",
    "\n",
    "        # Set data labels in the grid enumerating over all x,y class pairs.\n",
    "        # NOTE: X and Y are one element longer than the confusion matrix, so\n",
    "        # skip the last element in the enumeration to label grids.\n",
    "        for x in X[:-1]:\n",
    "            for y in Y[:-1]:\n",
    "\n",
    "                # Extract the value and the text label\n",
    "                value = cm_display[x,y]\n",
    "                svalue = \"{:0.0f}\".format(value)\n",
    "                if self.percent:\n",
    "                    svalue += \"%\"\n",
    "\n",
    "                # Determine the grid and text colors\n",
    "                base_color = self.cmap(value / cm_display.max())\n",
    "                text_color = find_text_color(base_color)\n",
    "\n",
    "                # Make zero values more subtle\n",
    "                if cm_display[x,y] == 0:\n",
    "                    text_color = CMAP_MUTEDCOLOR\n",
    "\n",
    "                # Add the label to the middle of the grid\n",
    "                cx, cy = x+0.5, y+0.5\n",
    "                self.ax.text(\n",
    "                    cy, cx, svalue, va='center', ha='center',\n",
    "                    color=text_color, fontsize=self.fontsize,\n",
    "                )\n",
    "\n",
    "                # Add a dark line on the grid with the diagonal. Note that the\n",
    "                # tick labels have already been reversed.\n",
    "                lc = 'k' if xticklabels[x] == yticklabels[y] else 'w'\n",
    "                self._edgecolors.append(lc)\n",
    "\n",
    "\n",
    "        # Draw the heatmap with colors bounded by vmin,vmax\n",
    "        vmin = 0.00001\n",
    "        vmax = 99.999 if self.percent == True else cm_display.max()\n",
    "        self.ax.pcolormesh(\n",
    "            X, Y, cm_display, vmin=vmin, vmax=vmax,\n",
    "            edgecolor=self._edgecolors, cmap=self.cmap, linewidth='0.01'\n",
    "        )\n",
    "\n",
    "        # Return the axes being drawn on\n",
    "        return self.ax\n",
    "\n",
    "    def finalize(self, **kwargs):\n",
    "        self.set_title('{} Confusion Matrix'.format(self.name))\n",
    "        self.ax.set_ylabel('True Class')\n",
    "        self.ax.set_xlabel('Predicted Class')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Let's see if they do now!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEQCAYAAABLMTQcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAG6BJREFUeJzt3XlgFPX5x/H3EiBcikZE0YoB0UcFKod4IUrrCWoV7wsvwKuotT/Ftp6otQi21taqRfFERWnFW7RiFQ9ECbfIExUQraCCcodgyP7+mElcQxICybLJN5/XP9md85k9PvOd78xOEslkEhERCUuDTBcgIiI1T+EuIhIghbuISIAU7iIiAVK4i4gESOEuIhKghpkuQKrOzBoBnwMz3f3oCqY5GRjs7r03sqwFQCFQQLSTzwLucveRNVhyybqOAfZ39xvi502Aa4FjgUS87tHAcHdPmtmbwN3u/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BYYbmb/cvc/lrN+EXXLSJ31JtDPzFrHv9K9l6j//R3gADPbOQ7U08qZdyJwqpklzKw18BbRUUIR0NDdlwOfmNnZAGZ2RDwPwOvA2fHjE9nwnikAI4FjzKxvPH8CuB5oXXJEEetB9KvNO4mOSPoAWWbWNa5portfRXT1kJnZZGArd/8rcCfqlpFKKNylTnL3GcBQ4A3gI6LP8rA4PC8jCuEPiE6qlnUPsBqYEU93mbuvJLo/z31mdhBwFjDQzGYCfyI60ZkEBgMnxcP7AivLqW0xUVD/n5nNiuvbnah/PdVrQAMzm0N0cnYB0M7dpwGTgNlmNjUe/grwB+BhM8sjOg9w46a8ZlK/6PYDIiIBUstdRCRACncRkQAp3EVEAqRwFxEJkMJdRCRACncRkQAp3EVEAqRwFxEJ0P8DzmCGNVJ7yi4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "model = AdaBoostClassifier()\n",
    "cm = ConfusionMatrix(model, percent=True)\n",
    "cm.fit(oX_train, oy_train)\n",
    "cm.score(oX_test, oy_test)\n",
    "cm.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAETCAYAAADXmaY8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XdgVfX9//HnzWQEgjGACEKgyhvFAUHqwL2lLqrWgXsUUeveWK2jarU/R2uRiuLCRa3W8a1axSoKqDUsA/KOMgQFQYgkQCCQm/v745xgjIwAubmB83r8k3vPfJ87XvdzPmcklkgkEBGRrVtaqgsQEZHkU9iLiESAwl5EJAIU9iIiEaCwFxGJAI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4e5lwJdmdgaAmR0ezgPwLnBG+PjX/Py+6QCPAr8ys/7h/DHg90C7mj2OUF/gK3d/gGCP5Wgg3cx6hzWNcfdrCM5OMjP7BGjl7g8CD6BuHNkAhb1s8dx9MnAb8B4wleBzfU8Ypr8jCOVPCQ7S1jUUWA5MDqf7nbsvJbiH/TAz2xcYCFxgZlOAuwkOnCaAS4ETw+H9gaVrqe07guC+2sw+D+vbiaB/vrb/AGlmNo3gYO9soKu7TwTGA8VmNiEc/iZwE/CkmRURHEe4dWNeM4ke3S5BRCQC1LIXEYkAhb2ISAQo7EVEIkBhLyISAQp7EZEIUNiLiESAwl5EJAL+PxIh16+obq7IAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "model = AdaBoostClassifier()\n",
    "cm = ConfusionMatrix(model, percent=True)\n",
    "cm.fit(gX_train, gy_train)\n",
    "cm.score(gX_test, gy_test)\n",
    "cm.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAEQCAYAAABLMTQcAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAHCZJREFUeJzt3XuA1XP+x/HnmUt3IVHuI5d3YklT2wXVugu5tLYUK7/NJpdULqvctrK0+JWsTRuLVBJWVn7EiopUtiG6rHdIWLfkUrrXzPz++H4np2lmmpo5nenT6/HPzPl8b+/vubzO5/v5fs85icLCQkREJCwZ6S5AREQqn8JdRCRACncRkQAp3EVEAqRwFxEJkMJdRCRAWekuQMrPzLKBT4H33f2MUub5NXC1u7ffyrqWAOuANURv8pnAcHcfVYklF23rLKClu98W364B3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BUSfwCyTu68ws65AFzM7guhIZC7wBbDGzGYALwC3xEckzwMTzew5ot78v7a2Ddl1Kdylqvky7hWXZk38NxN4yt17w6ZAziIK8uQj0pI+Ebkh+YaZHQZ8ltSUCaxNrsPMDgC+JxoSKVp/IVGQFzeHaIgneRsZwDNEQzZFbQcCU4mOBl4ieqM5zt03mllLojehDsBMM2vn7sPMbBJwNnC3mT3j7n8qYfsiGpaRndZU4Hwz2yf+lO6DROPvbwKtzGz/OFA7l7DsdOA3ZpYws32AaURHCRuBLHdfDnxoZhcDmNmp8TIArwIXx/9fwJbfmQIwCjjLzDrEyyeAW4F9io4oYi2IPrU5jOiI5Ewg08yOi2ua7u7XE109ZGY2G9jN3e8DhqFhGSmDwl12Su7+HjAQeA1YQPRcHhKH5zVEIfw20UnV4kYAq4D34vmucfefiL6fZ6SZtQG6AT3M7H3gLqITnYXA1UCnuL0D8FMJtX1NFNTXmdm8uL7DicbXk70CZJjZQqKTs0uAQ9z9XWAmMN/M3onbXwIGAI+ZWR7ReYDbt+U+k12Lvn5ARCRA6rmLiARI4S4iEiCFu4hIgBTuIiIBUriLiARI4S4iEiCFu4hIgBTuIiIB+n/1dKf11C8CRgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "model = AdaBoostClassifier()\n",
    "cm = ConfusionMatrix(model, percent=True)\n",
    "cm.fit(rX_train, ry_train)\n",
    "cm.score(rX_test, ry_test)\n",
    "cm.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
